<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>自主招生</title>
    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript"  src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="index.css">
  <link rel="stylesheet" href="main.css">
  <link rel="stylesheet" href="./swiper/dist/css/swiper.css">
  <script type="text/javascript" src="./static/store.legacy.min.js"></script>
  <script src="./static/util.js"></script>
</head>
<body>
  <!-- 自主招生页面 -->
  <header>
    <div class="headerSwipper">
      <div class="headerSwipper_div">
        <div class="headerSwipper_div_iconview">
          <img src="./static/images/logo.png" alt="">
        </div>
        <div class="headerSwipper_div_myicon">
          <!-- <img src="" alt=""> -->
          <span class="loginText">登录</span>
          <div class="headerSwipper_div_myicon_icon" style="display: none">
            <img src="./static/images/iconsmall.png" alt="">
          </div>
          <div class="headerSwipper_div_myicon_info">
            <ul>
              <li class="headerSwipper_div_myicon_info_li">消息</li>
              <li class="headerSwipper_div_myicon_info_li">退出</li>
            </ul>
          </div>
        </div>
        <ul class="headerSwipper_div_ul">
          <li class="headerSwipper_div_li mobileapp">手机APP</li>
          <li class="headerSwipper_div_li vipprop">开通VIP</li>
        </ul>
      </div>
    </div>
  </header>
  <section>
      <div class="ImgSwipperview">
          <!-- <img class="_img" src="./static/images/mainSwipper.png" alt=""> -->
          <div class="swiper-container">
            <div class="swiper-wrapper">
            </div>
            <!-- Add Arrows -->
            <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
        <div class="swiper-pagination"></div>
            <div class="swiper-button-prev"></div>
          </div>
        </div>
  </section>
  <section>
    <div class="mainContentView">
      <div class="contentView">
        <!-- 上侧导航 -->
        <div class="topnav">
          <ul class="contentView_ul">
            <li class="contentView_li contentView_li_active">首页</li>
            <li class="contentView_li">学习中心</li>
            <li class="contentView_li">志愿填报</li>
            <li class="contentView_li">微课</li>
            <li class="contentView_li">模拟试题</li>
            <li class="contentView_li">往届真题</li>
            <li class="contentView_li">咨询</li>
          </ul>
          <div class="inputview">
            <input class="inputview_input" id="tag" 
 type="text" placeholder="搜索院校">
            <img  class="searchicon_img" src="./static/images/searchicon.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </section>
  <!-- 学习中心 -->
  <section class="learnCenterPage">
    <div class="learncenterview">
      <div class="learncenter">
        <!-- 自主招生页面 -->
        <div class="questionView recruitment_more">
          <!-- <ul class="subjectNav">
            <li class="subjectNav_li">语文</li>
          </ul> -->
          <ul class="questionView_ul recruitment_ul_more">
            
          </ul>
        </div>
        <!-- 分页 来自index.html -->
        <p class="pagingView">
          <span class="pagebtn firstpage">首页</span>
          <span class="pagebtn frontpage">前一页</span>
          <span class="pagesview">
            <!-- 动态添加页码 -->
          </span>
          <span class="pagebtn backpage">后一页</span>
          <span class="pagebtn lastpage">尾页</span>
        </p>
      </div>
    </div>
  </section>


  <footer>
    <div class="footerSwipper">
      <div class="footerSwipper_div">
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span"><a href="./index.html">首页</a></span>
          <li class="footerSwipper_div_ul_li"><a href="./schools.html?keyword=">院校大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./major.html">专业大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mentality.html">心理辅导</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./careerPlanning.html">职业规划</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./infoTest.html">高考资讯</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=1">自主招生</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=2">单独招生</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">学习提升</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=3">微课</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=4">模拟试题</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=5">往届试题</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">志愿填报</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=6">咨询</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mobileapp.html">下载APP</a></li>
        </ul>
        <!-- 扫一扫关注我们区域 -->
        <div class="QRcodeSwipper">
          <span class="QRcodeSwipper_span">扫一扫关注我们</span>
          <div class="QRcodeSwipper_imgview">
            <img src="./static/images/qr.png" alt="">
          </div>
        </div>
        <!-- 中间信息区域 -->
        <div class="middleInfo">
          <span class="middleInfo_span_city">中国·河南·郑州</span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special phone_icon"><img src="./static/images/phone.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_color">0371-68064945</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/message.png" alt=""></span><span class="middleInfo_span_GE_text">595879735@qq.com</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/store.png" alt=""></span><span class="middleInfo_span_GE_text">河南柒佰伴教育信息咨询有限公司
          </span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special address_icon"><img src="./static/images/address.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_special">郑州市郑东新区立体世界
            </span></span>
        </div>
        <p class="footerSwipper_div_p">河南世霖网络软件科技 2014-2018 豫ICP备14010456号-1</p>
      </div>
    </div>
  </footer>
  <script src="./static/util.js"></script>
  <script src="./swiper/dist/js/swiper.js"></script>
  <script>
    var swiper = new Swiper('.swiper-container', {
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      pagination: {
        el: '.swiper-pagination',
      },
      observer:true,//修改swiper自己或子元素时，自动初始化swiper
      observeParents:true//修改swiper的父元素时，自动初始化swiper
    });
  </script>
  <script>
    $(document).ready(function(){
      // 初始化参数
      var currentpage = 1
      var pagestotal = 1
      var type_nav = getparse(location.href, 0)
      var testQuestion = {type_nav: type_nav, type: 1, page: 1}
      var possibleUrl = '/admin.php/api/homepage/zzzs_list'
      var indexlist = [8, 8, 8, 1, 3]
      var index = 0
      // .learncenter 导入导航标签方法
      // ArrowNavigation($('.learncenter'),["main","smallClass"])
      // 登录隐藏
      $('.headerSwipper_div_myicon_info').hide()
      // 记录li标签是否被点过 避免重复进行ajax 在点击一次加1 0> 10< 绕过ajax请求
      var liajaxUse = [0,0,0,0,0,0,0]
      // 渲染icon区域的图标
      // console.log($('.iconItems').find('.iconitem'))
      for(item in $('.iconItems').find('.iconitem')) {
        $('.iconItems').find('.iconitem').eq(item).find('img').attr('src','./static/images/icon0' + (Number(item)+1) + '.png')
      }
      // 监听li选择事件
      $('.contentView_ul').on('click', '.contentView_li', function() {
        
      })
      // 页码专属ajax
      function pageAjax(possibleUrl, testQuestion) {
        loadingShow()
        $.ajax({
          url: urlhost + possibleUrl,
          type: 'POST',
          data: testQuestion,
          header: {},
          success: function (res) {
            if (res.code == 0) {
              loadingHide()
              dataNow = res
              var domlist = [$('.topThree'), $('.questionView_ul_more')]
              rendering(domlist[currentRender], currentRender, dataNow.data)
            } else {
              // 移除加载中样式
              loadingHide()
              return(res.data)
            }
          },
          fail: function () {
            alert('网络有问题')
          }
        })
      }
      // 全局页码初始化改变方法
      function changeInitPage (a, b) {
        currentpage = b
        currentRender = b
        pagestotal = a
        pagefuc(pagestotal, currentRender)
      }
      // 页码方法
      function pagefuc (pagestotal, currentpage){
        // 页面初始化方法
        function init(pagestotal, currentpage) {
          if(pagestotal <= 5) {
            var html = ''
            $('.pagesview').html('')
            for(var i=1; i <= pagestotal; i++) {
              if(i == currentpage) {
                html += '<span class="pageitem pageactive" id="' + i + '">' + i + '</span>'
              }else {
                html += '<span class="pageitem" id="' + i + '">' + i + '</span>'
              }
            }
            $('.pagesview').html(html)
          }else {
            var html = ''
            $('.pagesview').html('')
            var length = (Math.floor(currentpage/5)+1)*5 >= pagestotal?pagestotal:Math.floor(currentpage/5)*5+5
            for(var i=(Math.floor((currentpage-1)/5)+1)*5-4; i <= length; i++) {
              if(i == currentpage) {
                html += '<span class="pageitem pageactive" id="' + i + '">' + i + '</span>'
              }else {
                html += '<span class="pageitem" id="' + i + '">' + i + '</span>'
              }
            }
            $('.pagesview').html(html)
          }
        }
        init(pagestotal, currentpage)
        }
        changeInitPage(pagestotal, currentpage)
         // 点击页码事件 页码变色 进行获取数据
      $('.pagingView').on('click', '.pageitem', function() {
        if($(this).hasClass('pageactive')) {
          return
        }
        $(this).parent().find('.pageitem').removeClass('pageactive')
        $(this).addClass('pageactive')
        currentpage = Number($(this).text())
        testQuestion.page = currentpage
        pageAjax(possibleUrl, testQuestion)
      })
      // 前一页事件
      $('.frontpage').click(
       function() {
          if(currentpage === 1) {
            return
          }
          if($('.pageactive').index() === 0) {
            $('#'+(currentpage+4)).remove()
            currentpage--
            $(this).parent().find('.pageitem').removeClass('pageactive')
            $('.pagesview').prepend('<span class="pageitem pageactive" id="' + currentpage + '">' + currentpage + '</span>')
            testQuestion.page = currentpage
            pageAjax(possibleUrl, testQuestion)
            return
          }
          currentpage--
          $(this).parent().find('.pageitem').removeClass('pageactive')
          $('#'+currentpage).addClass('pageactive')
          testQuestion.page = currentpage
          var dataNow =  ''
          pageAjax(possibleUrl, testQuestion)
        }
      )
      // 后一页事件
      $('.backpage').click(
         function() {
          // console.log(currentpage)
          if(currentpage === pagestotal) {
            return
          }
          if($('.pageactive').index() === 4) {
            $('#'+(currentpage-4)).remove()
            currentpage++
            $(this).parent().find('.pageitem').removeClass('pageactive')
            $('.pagesview').append('<span class="pageitem pageactive" id="' + currentpage + '">' + currentpage + '</span>')
            testQuestion.page = currentpage
            pageAjax(possibleUrl, testQuestion)
            return
          }
          currentpage++
          $(this).parent().find('.pageitem').removeClass('pageactive')
          $('#'+currentpage).addClass('pageactive')
          testQuestion.page = currentpage
          var dataNow =  ''
          pageAjax(possibleUrl, testQuestion)
        }
      )
      // 首页事件
      $('.firstpage').click(
         function() {
          currentpage = 1
          testQuestion.page = currentpage
          var dataNow =  ''
          pageAjax(possibleUrl, testQuestion)
          pagefuc(pagestotal, currentpage)
        }
      )
      // 末尾页点击事件
      $('.lastpage').click(
         function() {
          loadingShow()
          currentpage = pagestotal
          testQuestion.page = currentpage
          pageAjax(possibleUrl, testQuestion)
          pagefuc(pagestotal, currentpage)
        }
    )

      // 渲染子页面数据
      // 微课 topThree
      // <div class="classitem">
      //       <video src="" class="classitem_vidio"></video>
      //       <p class="classitem_p">语文高考知识点分析</p>
      //     </div>
      // 模拟试题 questionView_ul_more
      // <li class="testQuestion">
      //           <span class="leftimgview"><img class="leftimgview_img" src="./static/images/greentest.png" alt=""><span class="leftimgview_text">模拟</span></span>
      //           <div class="infotextview">
      //             <span class="infotextview_title">河南省郑州市高二语文期中试题</span>
      //             <span class="infotextview_time">2018-9-12 </span>
      //             </div>
      //         </li>
      function rendering (item, type, data) {
        var applyhtml = ''
        item.html('')
         // data获取的数据
         if(type == 0) {
          for(var i = 0; i < data.length; i++) {
            applyhtml += "<div class=\"classitem\" id=\"Curriculum" + data[i].id + "\">\n              <video src=" + data[i].stu_video + " class=\"classitem_vidio\" controls></video>\n              <img class=\"mainimg\" src=" + data[i].stu_pic + ">\n              <img class=\"palyer\" src=\"./static/images/player.png\">\n              <p class=\"classitem_p\">" + data[i].stu_title + "</p>\n            </div>";
          }
          item.html(applyhtml)
          return
        }
        if(type == 1) {
          for(var i = 0; i < data.length; i++) {
            applyhtml += '<li class="testQuestion" id="test' + data[i].id + '">'
               + '<span class="leftimgview"><img class="leftimgview_img" src="' + data[i].pics + '" alt=""><span class="leftimgview_text">模拟</span></span>'
               + '<div class="infotextview">'
                 + '<span class="infotextview_title">' + data[i].title + '</span>'
                 + '<span class="infotextview_time">' + data[i].add_time + '</span>'
                 + '</div>'
             + '</li>'
          }
          item.html(applyhtml)
          return
        }
        if(type == 8) {
          for(var i = 0; i < data.length; i++) {
            applyhtml += "<li class=\"collectNewsview\" id=\"careerPlanning" + data[i].id + "\">\n              <span class=\"collectNewsview_imgview\"><img class=\"collectNewsview_imgview_img\" src=" + data[i].pics + " alt=\"\"></span>\n              <div class=\"NewsTextview\">\n                <span class=\"NewsTextview_title\">" + data[i].title + "</span>\n                <span class=\"NewsTextview_text\">" + data[i].desc + "</span>\n                <span class=\"NewsTextview_time\">2018-11-24</span>\n              </div>\n              <div class=\"newsitemview\">\n                <span class=\"newsitemview_span\">\u67E5\u770B\u8BE6\u60C5</span>\n              </div>\n              </li>";
          }
          item.html(applyhtml)
          return
        }
        if(type == 4) {
          for(var i = 0; i < data; i++) {
            applyhtml += "<li class=\"questionView_ul_li\" id=\"consultView" + i + "\">\n            <div class=\"quiconview\"><img class=\"quiconview_img\" src=\"./static/images/over.png\" alt=\"\"></div>\n            <div class=\"textview\">\n              <span class=\"textview_title\">\u4F60\u597D\uFF0C\u8BF7\u5E2E\u6211\u628A\u9AD8\u8003\u5E74\u4EFD\u6539\u62102021\u5E74\uFF0C\u8C22\u8C22\uFF0C\u5B69\u5B50\u5F53\u65F6\u7CCA\u6D82\u778E\u586B\u7684\uFF0C\u73B0\u5728\u624D\u53D1\u73B0\uFF0C\u8C22\u8C22\uFF01</span>\n              <span class=\"textview_time\">2018-09-06  16:26</span>\n              <span class=\"textview_answer\">\u7B54\uFF1A\u60A8\u597D\uFF0C\u8BF7\u5728\u5468\u4E00\u81F3\u5468\u4E949\uFF1A00-18:00\u62E8\u6253400-000-0000\u8FDB\u884C\u54A8\u8BE2\u3002</span>\n            </div>\n          </li>";
          }
          item.html(applyhtml)
          return
        }
        if(type == 3) {
          for(var i = 0; i < data.length; i++) {
            var spanhtml = ''
            spanhtml += '<span class="universitytext_lable_span">'+ data[i].rank +'</span>'
            for(list in data[i]) {
              if(list.slice(0, 5) == 'label') {
                if(data[i][list]) {
                  spanhtml += '<span class="universitytext_lable_span">' + data[i][list] + '</span>'
                }
              }
            }
            var nowhtml = '<li class="universityView" id="school' + data[i].school_id + '" school-id="' + data[i].id + '">'
             + '<span class="universityImgview"><img class="universityImgview_img" src="' + data[i].pic + '" alt=""></span>'
             + '<div class="universitytext">'
               + '<span class="universitytext_title">' + data[i].sch_name + '</span>'
               + '<p class="universitytext_lable">' + spanhtml + '</p>'
             + '</div>'
             + '<div class="addWish_shool">'
               + '<span class="addWishImgview_school"><img src="./static/images/GoItem.png" alt=""></span>'
             + '</div>'
           + '</li>'
            applyhtml += nowhtml
          }
          item.html(applyhtml)
          return
        }
      }
      // 试题上方科目选择列表 方法
      // <ul class="subjectNav">
      //       <li class="subjectNav_li">语文</li>
      //     </ul>
      function subjectApply (item, subjects) {
        item.find('.subjectNav').remove()
        var subject = ''
        for(var i=0; i < subjects.length; i++) {
          if(i == 0) {
            subject += '<li class="subjectNav_li subjectNav_li_active" id="' + i + '">' + subjects[i] + '</li>'
          }else {
            subject += '<li class="subjectNav_li" id="' + i + '">' + subjects[i] + '</li>'
          }
        }
        subject = '<ul class="subjectNav">' + subject + '</ul>'
        item.prepend(subject)
      }
      // 监听选项选择改变事件
      $('.recruitment_more').on('click', '.subjectNav_li',  function (){
        clickchange($(this), '.subjectNav_li', 'subjectNav_li_active')
        // ajax获取值 重新redering
        testQuestion.type = Number($(this).index()) + 1
        index = $(this).index()
        possibleUrl='/admin.php/api/homepage/zzzs_list'
        if(index == 4) {
          possibleUrl = '/admin.php/api/homepage/zyx_list'
        }
        var initdata = ''
        var that = this
        $.ajax({
            url: urlhost + possibleUrl,
            type: 'POST',
            data: testQuestion,
            header: {},
            success: function (res) {
              if (res.code == 0) {
                loadingHide()
                initdata = res
                rendering ($('.recruitment_ul_more'), indexlist[$(that).index()], initdata.data)
                currentpage = 1
                pagestotal = initdata.last_page
                changeInitPage(pagestotal, currentpage)

              } else {
                // 移除加载中样式
                loadingHide()
                return(res.data)
              }
            },
            fail: function () {
              alert('网络有问题')
            }
          })
      })
      // 监听查看详情事件
      $('.learncenterview').on('click', '.newsitemview', function() {
        var itemid = $(this).parents('li').attr('id').slice(14)
        // window.location.href = './item.html?id=' + itemid
        window.open('./item.html?id=' + itemid)
      })
      // 监听大学点击事件
      $('.learncenterview').on('click', '.universityView', function() {
        var itemid = $(this).attr('id').slice(6)
        var schoolid = $(this).attr('school-id')
        // window.location.href = './shoolitem.html?id=' + itemid
        window.open('./shoolitem.html?id=' + itemid + '&type=' + type_nav + '&schoolid=' + schoolid)
      })
      // 监听试题点击事件
      $('.learncenterview').on('click', '.testQuestion', function() {
        var itemid = $(this).attr('id').slice(4)
        // window.location.href = './textItem.html?id=' + itemid
        window.open('./testItem.html?id=' + itemid)
      })
      // 页面首页初始化
      function pageinit () {
        if(type_nav == 1) {
          ArrowNavigation($('.learncenter'),["main","recruitment"])
        }else if(type_nav ==2) {
          ArrowNavigation($('.learncenter'),["main","recruitmentss"])
        }
        subjectApply($('.recruitment_more'), ['招生动态','报考指南','招生简章','往届真题','招生院校'])
        $('.subjectNav_li').eq(0).click()
      }
      pageinit()
      // li标签点击 需要跳转页面 同时传递第几个 进行初始化
      $('.contentView_li').click(
        function() {
          var index = $(this).index()
          window.location.href = './index.html?index=' + index
        }
      )
      window.addEventListener("hashchange",function(event){
        // console.log('hahah')
      });

      // 轮播图获取
      $.ajax({
        url: urlhost + '/admin.php/api/homepage/pc_banner',
        method: 'POST',
        data: {
          type: 1
        },
        success: function(res) {
          // <div class="swiper-slide">
          //   <img class="_img" src="./static/images/mainSwipper.png" alt="">
          // </div>
          $('.swiper-wrapper').empty()
          var html = ''
          for(var i=0;i<res.data.length;i++) {
            html += '<div class="swiper-slide">'
              + '<img class="ImgSwipperview_img" src="' + res.data[i].pic + '" alt="">'
            + '</div>'
          }
          $('.swiper-wrapper').html(html)
        }
      })
    })
  </script>
  </body>
</html>
